<script type="text/javascript" language="javascript" charset="utf-8">
$(".header-con li a").removeClass("open-menu");
$(".header-con li #statistical_datum").addClass("open-menu");
</script>
<div class="boxed clearfix">
  <div class="common-tit">
    <h2>综合数据</h2>
    <span>数据统计 > 综合数据</span>
    <div class="cours-gbtn">
      <div class="list-box">
        <div class="downbtn">
          <span>全部分店</span>
          <em></em>
        </div>
        <ul class="dropdown-menu">
          <li data_id="all">全部分店</li>
          <% @studios.each do |stu| %>
            <li data_id="<%= stu.id %>"><%= stu.name %></li>
          <%end%>
        </ul>
      </div>
    </div>
  </div>
  <div class="global-data">
    <div class="com-statcon">
      <div class="com-statbox">
        <div class="com-statistics">
          <div>
            <h4><%= @student_count %></h4>
            <span>学员人数(人)</span>
          </div>
          <div>
            <h4><%= @potential_student_count %></h4>
            <span>意向学员人数(人)</span>
          </div>
          <div>
            <h4><%= @expire %></h4>
            <span>即将过期学员(人)</span>
          </div>
        </div>
        <div class="com-statistics">
          <div>
            <h4><%= @finance_income %></h4>
            <span>累计营业额(金额)</span>
          </div>
          <div>
            <h4><%= @finance_expend %></h4>
            <span>累计支出(金额)</span>
          </div>
          <div>
            <h4><%= @course_reckons %></h4>
            <span>累计课消(金额)</span>
          </div>
          <div>
            <h4><%= @finance_income - @finance_expend %></h4>
            <span>账面金额(金额)</span>
          </div>
        </div>
      </div>
    </div>
    <div class="com-schedule">
     <h3><%= @studio_name %> - 本月进度</h3>
      <div class="pro-schedule">
        <% if @market_width.to_f < 50 %>
          <div class="pro-scbox clearfix">
        <%elsif @market_width.to_f >= 50 && @market_width.to_f < 80 %>
          <div class="pro-scbox passed clearfix">
        <%elsif @market_width.to_f >= 80 %>
          <div class="pro-scbox fulfilled clearfix">
        <% end %>
          <strong>招生进度</strong>
          <div class="sch-data">
         <span><%= @student_progress %></span>
            <em>人</em>
          </div>
          <div class="pro-bar">
            <div style="width: <%= @market_width %>%">
              <b><%= @market_width %>%</b>
            </div>
          </div>
          <span><%= @market_target %></span>
          <em>人</em>
        </div>
      </div>
     <div class="pro-schedule">
        <% if @service_width.to_f < 50 %>
          <div class="pro-scbox clearfix">
        <%elsif @service_width.to_f >= 50 && @service_width.to_f < 80 %>
          <div class="pro-scbox passed clearfix">
        <%elsif @service_width.to_f >= 80 %>
          <div class="pro-scbox fulfilled clearfix">
        <% end %>
          <strong>服务进度</strong>
           <div class="sch-data">
             <span><%= @students_expent %></span>
              <em>元</em>
            </div>
          <div class="pro-bar">
            <div style="width: <%= @service_width %>%">
              <b><%= @service_width %>%</b>
            </div>
          </div>
          <span><%= @service_target %></span>
          <em>元</em>
        </div>
      </div>
      <div class="pro-schedule">
        <% if @reckon_width.to_f < 50 %>
          <div class="pro-scbox clearfix">
        <%elsif @reckon_width.to_f >= 50 && @reckon_width.to_f < 80 %>
          <div class="pro-scbox passed clearfix">
        <%elsif @reckon_width.to_f >= 80 %>
          <div class="pro-scbox fulfilled clearfix">
        <% end %>
          <strong>课消进度</strong>
          <div class="sch-data">
             <span><%= @students_reckon %></span>
            <em>元</em>
          </div>
          <div class="pro-bar">
            <div style="width: <%= @reckon_width %>%">
              <b><%= @reckon_width %>%</b>
            </div>
          </div>
          <span><%= @teacher_target %></span>
          <em>元</em>
        </div>
      </div>
    </div>
  </div>
</div>
<script src="/assets/js/common-list.js"></script>

<script type="text/javascript">
  $(".cours-gbtn .list-box li").on("click", function() {
    $(this).parent().parent().find("span").attr("data_id", $(this).attr("data_id"));
    transD = $(this).attr("data_id");
    $.ajax({
      type:'get', url:"/admin/statistical_datum/change_comprehensive?studio_id="+ transD,
      success: function(data) {
        if (data.error) {
        // console.log("wrong");
        } 
      }
    });
  });
</script>